<template>
  <el-table-column :prop="props.prop" :label="props.label" v-bind="$attrs" :width="props.width">
    <template #default="scope">
      <slot :row="scope.row">{{ ObjectUtil.isEmptyToVal(scope.row[props.prop], props.emptyStr) }}</slot>
    </template>
  </el-table-column>
</template>

<script setup lang="ts">
import { ElTableColumn } from 'element-plus'
import { ObjectUtil } from '@utils/object-util'

const props = withDefaults(defineProps<{
  prop?: string,
  label?: string,
  emptyStr?: string,
  width?: string | number
}>(), {
  emptyStr: '/'
})
</script>
<style lang="scss" scoped>
</style>
